package com.biostime.springdraw.modules.sys.entity;

import java.util.List;

import com.biostime.springdraw.common.persistence.TreeEntity;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.collect.Lists;

/**
 * 菜单表Entity
 * @author phil
 * @version 2015-11-08
 */
public class Menu extends TreeEntity<Menu> {

	private static final long serialVersionUID = 1L;
	
	private String name;// 名称
	private String href;// 链接
	private String target;// 目标（mainFrame、 _blank、_self、_parent、_top）
	private String icon;// 图标
	private String isShow;// 是否在菜单中显示（1：显示；0：不显示）
	private String navId;//菜单标识
	private String permission;// 权限标识
	
	private String userId;
	
	private List<RolePermissions> permissions = Lists.newArrayList(); //角色权限
	
	public Menu(){
		super();
		this.sort = 30;
		this.isShow = "1";
		this.target = "mainframe";
	}
	
	public Menu(String id){
		super(id);
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public String getHref() {
		return href;
	}

	public void setHref(String href) {
		this.href = href;
	}
	
	public String getTarget() {
		return target;
	}

	public void setTarget(String target) {
		this.target = target;
	}
	
	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}
	
	public String getIsShow() {
		return isShow;
	}

	public void setIsShow(String isShow) {
		this.isShow = isShow;
	}
	
	public String getPermission() {
		return permission;
	}

	public void setPermission(String permission) {
		this.permission = permission;
	}

	@Override
	public Menu getParent() {
		return this.parent;
	}

	@Override
	public void setParent(Menu parent) {
		this.parent = parent;
	}

	public String getUserId() {
		return userId;
	}

	@JsonIgnore
	public static String getRootId(){
		return "1";
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getNavId() {
		return navId;
	}

	public void setNavId(String navId) {
		this.navId = navId;
	}

	public List<RolePermissions> getPermissions() {
		return permissions;
	}

	public void setPermissions(List<RolePermissions> permissions) {
		this.permissions = permissions;
	}
}